import sqlite3
# 建表

con = sqlite3.connect("db1.db")

sql = 'create table t_person(pno INTEGER PRIMARY KEY  AUTOINCREMENT ,pname varchar(30) NOT NULL ,age INTEGER)'

cursor = con.cursor()

cursor.execute(sql)

try:
    cursor.execute(sql)
except Exception as e:
    print(e)
    print("创建表失败")
finally:
    cursor.close()
    con.close()



# print(con)